<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>

<% 
	String path = request.getContextPath();
	String processDefinitionId = (String)request.getAttribute("processDefinitionId");
	String width = (String)request.getAttribute("width");
	String height = (String)request.getAttribute("height");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>process image</title>
<script type="text/javascript">

</script>

<style type="text/css">
.div1 {
	position: relative;
	background-image: url(<%=path %>/jbpmProcessImageServlet.jbpm?processDefinitionId=<%= processDefinitionId %>);
	width: <%=width %>px;
	height: <%=height %>px;
}	

<%
	List<Map<String,String>> mapList = (List<Map<String,String>>)request.getAttribute("mapList");
	for (int i=0; i<mapList.size(); i++) {
		Map<String,String> map = mapList.get(i);
		String x = map.get("x");
		String y = map.get("y");
		String w = (Long.parseLong(map.get("w"))-6)+"";
		String h = (Long.parseLong(map.get("h"))-6)+"";
		//yes/no
		String isCurrentTaskToken = (String)map.get("isCurrentTaskToken");
%>
.div_<%= i %> {
	position: absolute;
	left: <%=x %>px;
	top: <%=y %>px;
	width: <%=w %>px;
	height: <%=h %>px;
	border: 5px solid <%= isCurrentTaskToken=="yes"?"red":"green" %>;
}
<%
	}
%>
</style>

</head>
<body>

<div class="div1">
<%
	for (int i=0; i<mapList.size(); i++) {
%>
		<div class="div_<%= i %>"></div>
<%
	}
%>
</div>


</body>
</html>